package org.emaait.app.aop.log;

import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class AfterReturnLogAdvice {
	private static final Logger log=Logger.getLogger(AfterReturnLogAdvice.class);
	
	@Pointcut("execution(* org.emaait.app.service..*.*(..))")
	public void afterReturnLogPointcut(){}
	@AfterReturning(
			pointcut="afterReturnLogPointcut()"
			,returning="retVal")
	public void afterReturnLogAdvice(JoinPoint jp,Object retVal){
		log.info(jp);
		log.info("Service method return:"+retVal);
	}
}
